


  const log_detection ={
    wait:60,
    timeCode:function(that,elem){
      
  
          if (log_detection.wait == 0) {
  
              that.code_status=true;

              elem.target.childNodes[0].innerHTML="获取验证码";
  
              log_detection.wait = 60;
  
          } else {
  
              that.code_status=false;
  
              elem.target.childNodes[0].innerHTML="验证码(" + log_detection.wait + ")";
  
              log_detection.wait--;
  
              setTimeout(function() {
                log_detection.timeCode(that,elem)
              },
              1000)
          }
  
  
    },
    input_phone:function(that,param){
      if (param == "phone") {
          if (that.phone.length == 1) {
              if (that.phone != 1) {
                   that.phone = "";
                     return false
              }
          } else if (that.phone.length == 2) {
              if (that.phone == '11' || that.phone == '12') {
                   that.phone = "1";
                     return false
              }
          }
          that.phone = that.phone.replace(/\D/g, '')
          return true
      }
     
      return true
    },
    login:function(that,param){
      if (!that.base.empty_b(that.phone)) {
          that.$toast({  message: '请输入手机号码',position: 'bottom'  });
  
          return false
  
      }else if(that.phone.length<11){
  
           that.$toast({  message: '请输入十一位数的手机号码',position: 'bottom'  });
  
          return false
  
      }else if (!that.base.empty_b(that.pwd)) {
  
           that.$toast({    message: '请输入密码',  position: 'bottom'  });
  
          return false
  
      }else if(that.pwd.length<6){
  
           that.$toast({  message: '请输入六位数以上的密码',position: 'bottom'  });
  
          return false
  
      }else if(!that.base.detSql(that.pwd)){
  
           that.$toast({  message: '密码含有非法字符',position: 'bottom'  });
  
          return false
  
      }
  
  
      if(param=="reg"){
  
          if(!that.base.empty_b(that.Invitation)){
            that.$toast({  message: '请输入邀请码',position: 'bottom'  });
            return false;
          }else if(that.Invitation.length<6){
              that.$toast({  message: '请输入六位数的邀请码',position: 'bottom'  });
              return false;
            }else if(!that.base.empty_b(that.sms)){
              that.$toast({  message: '请输入验证码',position: 'bottom'  });
            return false;
          }else if(that.sms.length!=4){
   
            that.$toast({  message: '请输入四位数的验证码',position: 'bottom'  });
          return false;
  
        }else if(!that.Invit_status){
          that.$toast({  message: '请输入正确的邀请码',position: 'bottom'  });
          return false;
        }
        // else if(!that.base.empty_b(that.crm_pws)){
        //       that.$toast({  message: '请输入确认密码',position: 'bottom'  });
        //   return false;
        // }else if(that.crm_pws.length<6){
        //       that.$toast({  message: '请输入六位数的确认密码',position: 'bottom'  });
        //   return false;
        // }else if(that.crm_pws!=that.pwd){
        //   that.$toast({  message: '俩次密码输入不一致',position: 'bottom'  });
        //   return false;
        // }
      }
  
  
        return true
    }
  }
  module.exports=log_detection;

